package com.woniu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.entity.PageData;
import com.woniu.entity.dto.PaymentstatisticsDTO;
import com.woniu.mapper.AdminMapper;
import com.woniu.mapper.OrderMapper;
import com.woniu.mapper.PaymentStatisticsMapper;
import com.woniu.pojo.Admin;
import com.woniu.pojo.Order;
import com.woniu.pojo.PaymentStatistics;
import com.woniu.service.OrderService;
import com.woniu.service.PaymentStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;

public class PaymentStatisticsServiceImpl extends ServiceImpl<PaymentStatisticsMapper, PaymentStatistics>
        implements PaymentStatisticsService {


    @Autowired
    private PaymentStatisticsMapper paymentStatisticsMapper;


//    @Override
//    public PageData getByDate(Integer currentPage, Integer pageSize, PaymentstatisticsDTO paymentstatisticsDTO) {
//        // 1. 构建查询条件
//        LambdaQueryWrapper<Admin> wrapper = new LambdaQueryWrapper<>();
//        if(PaymentstatisticsDTO != null){
//            wrapper.like(!StringUtils.isEmpty(queryAdminDTO.getAccount()), Admin::getAccount, queryAdminDTO.getAccount());
//            wrapper.like(!StringUtils.isEmpty(queryAdminDTO.getPhone()), Admin::getPhone, queryAdminDTO.getPhone());
//        }
//        // 2. 构建分页参数
//        IPage<Admin> page = new Page<>(currentPage, pageSize);
//        // 3. 调用mapper查询
//        IPage<Admin> trainerIPage = PaymentStatisticsMapper.selectPage(page, wrapper);
//        // 4. 组装返回数据对象
//        PageData pageData = new PageData(trainerIPage.getTotal(), trainerIPage.getRecords());
//        // 5. 返回数据
//        return pageData;
//    }
}
